﻿//using UnityEngine;

//public class BulletBuff : BuffBase
//{
//    private BulletAttribute lastBulletAttribute;
//    private PlayerAttribute PlayerAttribute;
//    private BulletBuffConfig bulletBuffConfig;
//    public BulletBuff(int BuffID, Transform target, BuffConfigBase configBase) : base(BuffID, target, configBase)
//    {
//        bulletBuffConfig = configBase as BulletBuffConfig;
//        if (target.TryGetComponent<PlayerAttribute>(out var playerAttribute))
//        {
//            PlayerAttribute = playerAttribute;
//            lastBulletAttribute = playerAttribute.bulletAttribute.Clone();
//        }
//        else
//        {
//            Remove();
//        }
//    }

//    public override void Apply()
//    {
//        if (PlayerAttribute == null)
//        {
//            return;
//        }
//        PlayerAttribute.bulletAttribute.IsPierce |= bulletBuffConfig.BulletAttribute.IsPierce;
//        PlayerAttribute.bulletAttribute.IsRebound |= bulletBuffConfig.BulletAttribute.IsRebound;

//        //改变当前武器子弹的buff属性
//        PlayerAttribute.GetComponent<PlayerController>().UpdateBulletAttribute();
//    }

//    public override void Update()
//    {
       
//    }
//    public override void Remove()
//    {
//        if (bulletBuffConfig.buffTime != 0)
//        {
//            if (PlayerAttribute != null)
//            {
//                PlayerAttribute.bulletAttribute.IsPierce = lastBulletAttribute.IsPierce;
//                PlayerAttribute.bulletAttribute.IsRebound = lastBulletAttribute.IsRebound;
//                PlayerAttribute.GetComponent<PlayerController>().UpdateBulletAttribute();
//            }
//        }
//        base.Remove();
//    }
//}
